import request from '@/utils/request';

//1.设置登录的api请求
//配置info类型限制
export interface infoParamsType {
  password: string,
  username: string,
}
export interface resLoginType {
  token: string;
}
export const reqLogin = (infoParams: infoParamsType) => {
  return request.post<any, resLoginType>(`/admin/acl/index/login`, infoParams);
};
//2.登出请求
export const reqLogout = () => {
  return request.post<any, null>(`/admin/acl/index/logout`);
};
//3.获取用户信息请求
//设置返回值类型
export interface userInfoType {
  routes: string[],
  buttons: string[],
  roles: string[],
  name: string,
  avatar: string
}

export const reqUserInfo = () => {
  return request.get<any,userInfoType>(`/admin/acl/index/info`);
};
